<?php 
//get querystring
$queryString = Zend_Controller_Front::getInstance()->getRequest()->getQuery();
?>

<?php if ($this->pageCount>1): ?>
<div class="paginationControl" align="center">
<?php 
	$href ="?";
	$hrefData = $queryString;
	
	unset($hrefData['page']);
	foreach($hrefData as $k => $v){
		$href.="&{$k}=".urlencode($v);
	}
	if (isset($this->first) && $this->first != $this->current){
		
		$url = $this->url().$href."&page=$this->first";
		$url = str_replace('?&','?', $url);
		echo "<a href={$url}>First</a>";
	
	}
    if (isset($this->previous)){

    	$url = $this->url().$href."&page=$this->previous";
    	$url = str_replace('?&','?', $url);
    	echo "<a href={$url}>< Prev</a>";

    }
    foreach ($this->pagesInRange as $page){
       if ($page == $this->current){
               echo  '<b>' . $page . '</b>';
      }else{

      	$url = $this->url().$href."&page=$page";
      	$url = str_replace('?&','?', $url);
      	echo "<a href={$url}>$page</a>";


      }
   }
   if (isset($this->next)){
	   	
	   	$url = $this->url().$href."&page=$this->next";
	   	$url = str_replace('?&','?', $url);
	   	echo "<a href={$url}>Next</a>";

       }
   if (isset($this->last) && $this->last != $this->current){
			$url = $this->url().$href."&page=$this->last";
			$url = str_replace('?&','?', $url);
			echo "<a href={$url}>last</a>";

   }
  ?>
</div>
<?php endif; ?>
